<#-- 导入变量定义文件 -->
<#include "../template/include/assign.ftl">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>订单信息</title>
<#-- 导入静态资源文件 -->
<#include "../template/include/source.ftl">
    <link href="${web_static}/admin/css/list.css" rel="stylesheet" type="text/css"/>
    <style type="text/css">
        .page {
            float: right;
            padding-top: 15px;
            margin-right: 15px;
        }
    </style>
</head>
<#include "../template/template_listPage.ftl">
<body class="list">
<script type="text/javascript">
    $(document).ready(function () {
		<#if actionErrors??&&(actionErrors?size > 0)>
			$.dialog({type: "warn", content: "<#list errorMessages as list>${list}<br></#list>",
			 modal: true, autoCloseTime: 3000});
		</#if>
    });

    function deleteOperation(id) {
        var result = confirm("你确认要删除吗?");
        if (result) {
            var url = "${web_base}/recharge/dict!delete.htm?dict.id=" + id;
            document.forms[0].action = url;
            document.forms[0].submit();
        }
    }
</script>
<div class="body">
<#if page??>
    <@pageList page=page id="listForm" action="${web_base}/recharge/orders!ordersList.htm" query="ordersQuery" isEmpty=true >
        <div class="listBar">

            <div class="operateBar">
                查找:
                订单流水号：<input type="text" name="ordersQuery.id"
                             value="<#if ordersQuery??&&ordersQuery.id??>${(ordersQuery.id)!}</#if>"/>
                是否支付：<select name="ordersQuery.pay" id="goodsState">
                <option value="" selected="selected">请选择...</option>
                <option value="true" <#if ordersQuery??&&ordersQuery.pay??&&ordersQuery.pay>selected="selected" </#if>>
                    是
                </option>
                <option value="false"
                        <#if ordersQuery??&&ordersQuery.pay??&&!ordersQuery.pay>selected="selected" </#if>>
                    否
                </option>
            </select>
                订单类型：
                <select name="ordersQuery.type" id="rechargeMode">
                    <option value="" selected="selected" value="">请选择...</option>
                    <option value="1"
                            <#if ordersQuery??&&ordersQuery.type??&&ordersQuery.type==1>selected="selected" </#if>>
                        直充
                    </option>
                    <option value="0"
                            <#if ordersQuery??&&ordersQuery.type??&&ordersQuery.type==0>selected="selected" </#if>>
                        卡充
                    </option>
                </select>
                <input type="submit" id="searchButton" class="searchButton" value=""/>
            </div>


        </div>
        <table class="listTable">
            <tr>
                <th>
                    <span class="sort" name="name">订单号</span>
                </th>
                <th>
                    <span class="sort" name="remark">充值号码</span>
                </th>
                <th>
                    <span class="sort" name="name">面额（元）</span>
                </th>
                <th>
                    <span class="sort" name="remark">类型</span>
                </th>
                <th>
                    <span class="sort" name="name">成本价（元）</span>
                </th>
                <th>
                    <span class="sort" name="name">代理商价（元）</span>
                </th>
                <th>
                    <span class="sort" name="name">利润（元）</span>
                </th>
                <th>
                    <span class="sort" name="remark">商品名称</span>
                </th>
                <th>
                    <span class="sort" name="remark">是否支付</span>
                </th>
                <th>
                    <span class="sort" name="remark">是否充值成功</span>
                </th>
                <th>
                    操作
                </th>
            </tr>

            <div class="operateBar">
            </div>
            <#if page.list??>
                <#list page.list as entry>
                    <tr>
                        <td>
                        ${(entry.id)!}
                        </td>
                        <td>
                        ${(entry.buyer)!}
                        </td>
                        <td>
                        ${money((entry.sellingPrice)!)}
                        </td>
                        <td>
                            <#if entry.type??&&entry.type==0>卡冲<#elseif entry.type??&&entry.type==1>直冲<#else >未知</#if>
                        </td>
                        <td>
                        ${money((entry.costPrice)!)}
                        </td>
                        <td>
                        ${money((entry.agentPrice)!)}
                        </td>
                        <td>
                        ${money((entry.profit)!)}
                        </td>
                        <td>
                        ${(entry.productName)!}
                        </td>
                        <td>
                            <#if entry.pay >是<#else>否
                                <a href="${web_base}/recharge/orders!edit.htm?orders.id=${(entry.id)!}&editPay=true"
                                   title="编辑">[编辑]</a>
                            </#if>
                        </td>
                        <td>
                            <#if entry.orderSuccess?? &&entry.orderSuccess>是<#else>否
                                <a href="${web_base}/recharge/orders!edit.htm?orders.id=${(entry.id)!}&editPay=false"
                                   title="编辑">[编辑]</a>
                            </#if>
                        </td>
                        <td>
                            <a href="${web_base}/recharge/orders!edit.htm?orders.id=${(entry.id)!}">[详情]</a>
                            <a href="${web_base}/recharge/orders!delete.htm?orders.id=${(entry.id)!}"
                               onclick=" return confirm('确定要删除该订单吗？');"
                               title="编辑">[删除]</a>
                        </td>
                    </tr>
                </#list>
            </#if>
        </table>
    </@pageList></#if>
</div>
</body>
